package bridge.extend;

/**
 * @ClassName ExtendTest
 * @Author Alex2
 * @Date 2025/3/21 13:39
 **/

interface Computer{
    void info();
}

class Desktop implements Computer{
    @Override
    public void info() {
        System.out.println("台式机");
    }
}

class Laptop implements Computer{
    @Override
    public void info() {
        System.out.println("笔记本");
    }
}

class XiaomiDesktop extends Desktop{
    @Override
    public void info() {
        System.out.println("小米台式机");
    }
}

class HuaweiDesktop extends Desktop{
    @Override
    public void info() {
        System.out.println("华为台式机");
    }
}

class XiaomiLaptop extends Laptop{
    @Override
    public void info() {
        System.out.println("小米笔记本");
    }
}

class HuaweiLaptop extends Laptop {
    @Override
    public void info() {
        System.out.println("华为笔记本");
    }
}

public class ExtendTest {
    public static void main(String[] args) {
        XiaomiDesktop xiaomiDesktop = new XiaomiDesktop();
        xiaomiDesktop.info();

        HuaweiDesktop huaweiDesktop = new HuaweiDesktop();
        huaweiDesktop.info();

        XiaomiLaptop xiaomiLaptop = new XiaomiLaptop();
        xiaomiLaptop.info();

        HuaweiLaptop huaweiLaptop = new HuaweiLaptop();
        huaweiLaptop.info();
    }
}